package cn.home.service.Impl;

import cn.home.entity.Users;
import cn.home.mapper.UserDetailMapper;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 邹洪辉
 * @version 1.0
 * @date 2023/3/2 - 19:35
 */
@Service
public class UserDetailServiceImpl implements UserDetailsService {
    @Resource
    private UserDetailMapper userDetailMapper;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        Users users = userDetailMapper.getUserByName(username);
        return users;
    }
}
